/*
Navicat MySQL Data Transfer

Source Server         : localhost
Source Server Version : 50615
Source Host           : localhost:3306
Source Database       : mydatadase

Target Server Type    : MYSQL
Target Server Version : 50615
File Encoding         : 65001

Date: 2013-12-28 01:53:59
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for cathedra
-- ----------------------------
DROP TABLE IF EXISTS `cathedra`;
CREATE TABLE `cathedra` (
  `ObjectId` int(11) NOT NULL,
  `CathedraId` int(11) NOT NULL,
  `Header` varchar(255) DEFAULT NULL,
  `ClassNumber` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ObjectId`),
  CONSTRAINT `Cathedra_TypeConstraint_From_Department_To_Cathedra` FOREIGN KEY (`ObjectId`) REFERENCES `department` (`ObjectId`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for department
-- ----------------------------
DROP TABLE IF EXISTS `department`;
CREATE TABLE `department` (
  `ObjectId` int(11) NOT NULL,
  `DepartmentId` int(11) NOT NULL,
  `Address` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ObjectId`),
  CONSTRAINT `Department_TypeConstraint_From_RootObject_To_Department` FOREIGN KEY (`ObjectId`) REFERENCES `rootobject` (`ObjectId`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for faculty
-- ----------------------------
DROP TABLE IF EXISTS `faculty`;
CREATE TABLE `faculty` (
  `ObjectId` int(11) NOT NULL,
  `FacultyId` int(11) NOT NULL,
  `Dean` varchar(255) DEFAULT NULL,
  `DeaneryRoom` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ObjectId`),
  CONSTRAINT `Faculty_TypeConstraint_From_Department_To_Faculty` FOREIGN KEY (`ObjectId`) REFERENCES `department` (`ObjectId`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for folder
-- ----------------------------
DROP TABLE IF EXISTS `folder`;
CREATE TABLE `folder` (
  `ObjectId` int(11) NOT NULL,
  `FolderId` int(11) NOT NULL,
  `Location` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ObjectId`),
  CONSTRAINT `Folder_TypeConstraint_From_RootObject_To_Folder` FOREIGN KEY (`ObjectId`) REFERENCES `rootobject` (`ObjectId`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for person
-- ----------------------------
DROP TABLE IF EXISTS `person`;
CREATE TABLE `person` (
  `ObjectId` int(11) NOT NULL,
  `PersonId` int(11) NOT NULL,
  `Address` varchar(255) DEFAULT NULL,
  `Nationality` varchar(255) DEFAULT NULL,
  `DateOfBirth` datetime NOT NULL,
  PRIMARY KEY (`ObjectId`),
  CONSTRAINT `Person_TypeConstraint_From_RootObject_To_Person` FOREIGN KEY (`ObjectId`) REFERENCES `rootobject` (`ObjectId`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for rootobject
-- ----------------------------
DROP TABLE IF EXISTS `rootobject`;
CREATE TABLE `rootobject` (
  `ObjectId` int(11) NOT NULL,
  `ParentObjectId` int(11) NOT NULL,
  `Name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ObjectId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
  `ObjectId` int(11) NOT NULL,
  `StudentId` int(11) NOT NULL,
  `EnterDate` datetime NOT NULL,
  `TypeStudy` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ObjectId`),
  CONSTRAINT `Student_TypeConstraint_From_Person_To_Student` FOREIGN KEY (`ObjectId`) REFERENCES `person` (`ObjectId`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for teacher
-- ----------------------------
DROP TABLE IF EXISTS `teacher`;
CREATE TABLE `teacher` (
  `ObjectId` int(11) NOT NULL,
  `TeacherId` int(11) NOT NULL,
  `Post` varchar(255) DEFAULT NULL,
  `AcademicDegree` varchar(255) DEFAULT NULL,
  `Salary` int(11) NOT NULL,
  PRIMARY KEY (`ObjectId`),
  CONSTRAINT `Teacher_TypeConstraint_From_Person_To_Teacher` FOREIGN KEY (`ObjectId`) REFERENCES `person` (`ObjectId`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for __migrationhistory
-- ----------------------------
DROP TABLE IF EXISTS `__migrationhistory`;
CREATE TABLE `__migrationhistory` (
  `MigrationId` varchar(150) NOT NULL,
  `ContextKey` varchar(300) NOT NULL,
  `Model` longblob NOT NULL,
  `ProductVersion` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
